package com.qk.management.mapper;

import com.qk.dto.course.CourseDTO;
import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Just、倾城
 * @created 2025-10-11
 * @description
 *
 */
@Mapper
public interface CourseMapper  {
    List<Course> page(CourseDTO courseDTO);

    @Delete("delete from course where id = #{id}")
    void deleteById(Integer id);

    void add(Course course);

    @Select("select * from course where id = #{id}")
    Course selectById(Integer id);

    void update(Course course);

    @Select("select * from course")
    List<Course> listAll();

    @Select("select * from course where subject = #{subject}")
    List<Course> selectBySubject(String subject);
}
